<%= error_messages_for :image %>
<%= error_messages_for :image_file %>

<% form_for(:image, :url => {:action => 'create'}, 
                      :html => { :multipart => true }) do |f| -%>
  <p>
    <label for="title">Title:</label>
    <%= text_field 'image', 'title', :size => 50 %>
  </p>
  <p>
    <label for="category_id">Category:</label>
    <%= select("image", "category_id", Category.find(:all).collect {|p| [ p.name, p.id ] }, {:include_blank => 'None'}, {:style => 'width: 300px;'}) %>
  </p>
  <p>
    <label for="uploaded_data">Image:</label>
  <% fields_for "image_file" do |g| %>
         <%= g.file_field :uploaded_data, {'accept' => 'image/gif'} %>
        <% end %>

  </p>
  <p>
    <label for="text">Description:</label><br>
    <%= text_area 'image', 'description', :style => 'width: 580px; padding: 5px', :id => 'new_image_textarea', :onKeyUp => 'updatePreview(\'image\',\'new_image\');' -%>
  </p>
  <p>
    Tags: <%= text_field 'image', 'tag_list', :size => 50 %>
  </p>
  <p>
      <%= submit_tag "Add Image", :onClick => "hs.htmlExpand(this, { contentId: 'pleaseWait', align: 'center' } )" %>
  </p>
<% end -%>

<h2>Preview</h2><img src="/images/spinner.gif" style="display: none; border: 0;" id="new_image_preview_spinner" /><div id="new_image_preview"></div>
<div id="pleaseWait" style="text-align: center; width: 400px; height: 150px;font-weight: bold; font-size: 20px; padding-top: 50px;" class="highslide-html-content">Please Wait<br /><br /><img src="/images/big-spinner.gif" /></div>
